/*
 * @Author: Lin Hongwei
 * @Date: 2022-10-29 15:42:50
 * @LastEditTime: 2022-10-30 23:20:13
 * @LastEditors: Lin Hongwei
 * @email: 1365755396@qq.com
 * @CSDN: https://blog.csdn.net/weixin_45429409
 * @Description: 看板中间件
 */
/**
 * @description: 看板表单校验
 */
exports.kanbanValidatorMiddleware = (ctx, next) => {
  const { name, projectId } = ctx.request.body;
  if (!name || !projectId) return ctx.fail("项目Id或看板名称不能为空！");
  ctx.state.kanbanForm = { name, projectId };
  return next();
}